home *** CD-ROM | disk | FTP | other *** search
Lisp/Scheme | 1994-05-28 | 3.4 KB | 112 lines | [TEXT/xlsp] |
- ; initialization file for XLISP-PLUS 2.1g
-
- (princ "XLISP-PLUS 2.1g contains contributed code by:
- Tom Almy, Mikael Pettersson, Neal Holtz, Johnny Greenblatt, Ken Whedbee,
- Blake McBride, Pete Yadlowsky, Hume Smith, and Richard Zidlicky.
- Portions copyright (c) 1988, Luke Tierney.\n")
-
- ;; Set this up however you want it
- (setq *features* (list :xlisp :21g))
-
- ;; Differences in various implementations, needed by example programs
- (when (fboundp 'export)
- (setq *features* (cons :packages *features*)))
- #+:packages
- (in-package "XLISP")
- (when (fboundp 'get-internal-run-time)
- (setq *features* (cons :times *features*)))
- (when (fboundp 'generic)
- (setq *features* (cons :generic *features*)))
- (when (fboundp 'find-if)
- (setq *features* (cons :posfcns *features*)))
- (when (fboundp 'log)
- (setq *features* (cons :math *features*)))
- (when (alphanumericp #\M-C-@)
- (setq *features* (cons :pc8 *features*)))
- (when (fboundp 'values)
- (setq *features* (cons :mulvals *features*)))
- (when (fboundp 'get-key)
- (setq *features* (cons :getkey *features*)))
-
- #+:packages ;; These should not be exported from XLISP
- (unexport '(%copy-struct %struct-set %struct-ref %struct-type-p %make-struct))
-
- #-:packages
- (defun export (x)) ;; dummy definitions for package functions
- #-:packages
- (defun in-package (x))
-
- (export '(strcat set-macro-character get-macro-character savefun
- debug nodebug))
-
- (defun strcat (&rest str) ;; Backwards compatibility
- (apply #'concatenate 'string str))
-
-
- ; (set-macro-character ch fun [ tflag ])
- (defun set-macro-character (ch fun &optional tflag)
- (setf (aref *readtable* (char-int ch))
- (cons (if tflag :tmacro :nmacro) fun))
- t)
-
- ; (get-macro-character ch)
- (defun get-macro-character (ch)
- (if (consp (aref *readtable* (char-int ch)))
- (cdr (aref *readtable* (char-int ch)))
- nil))
-
- ; (savefun fun) - save a function definition to a file
- (defmacro savefun (fun)
- `(let* ((fname (strcat (symbol-name ',fun) ".lsp"))
- (fval (get-lambda-expression (symbol-function ',fun)))
- (fp (open fname :direction :output)))
- (cond (fp (print (cons (if (eq (car fval) 'lambda)
- 'defun
- 'defmacro)
- (cons ',fun (cdr fval))) fp)
- (close fp)
- fname)
- (t nil))))
-
- ; (debug) - enable debug breaks
- (defun debug ()
- (setq *breakenable* t))
-
- ; (nodebug) - disable debug breaks
- (defun nodebug ()
- (setq *breakenable* nil))
-
- ; initialize to enable breaks but no trace back
- (setq *breakenable* t *tracenable* nil)
-
-
- ; macros get displaced with expansion
- ; Good feature, but comment out to avoid shock.
- (setq *displace-macros* t)
-
- ;; Select one of these three choices
- ;; Other modes will not read in other standard lsp files
-
-
- ; print in upper case, case insensitive input
- ;(setq *print-case* :upcase *readtable-case* :upcase)
-
- ; print in lower case
- (setq *print-case* :downcase *readtable-case* :upcase)
-
- ; case sensitive, lowercase and uppercase swapped (favors lower case)
- ;(setq *print-case* :downcase *readtable-case* :invert)
-
- ; Make this "T" to use doskey or run under Epsilon
- ; Comment out altogether for non-MSDOS environments
- (setq *dos-input* nil)
-
- ;; Define Class and Object to be class and object when in case sensitive
- ;; mode
-
- (when (eq *readtable-case* :invert)
- (defconstant Class class)
- (defconstant Object object)
- (export '(Class Object)))
-
-